home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 426-450 / disk_445 / turbotext / rexx / windoworg.ttx < prev   
Text File  |  1992-05-06  |  919b  |  46 lines

  1.  
  2. /** $VER: WindowOrg.ttx Demo 1.0 (23.12.90)
  3.  **
  4.  ** Organize all document window on the screen.
  5.  **
  6.  ** Written by Steve Tibbett
  7.  ** Modified by Martin Taillefer
  8.  **/
  9.  
  10. OPTIONS RESULTS
  11.  
  12.  
  13.   GetDocuments
  14.   docs       = RESULT
  15.   numWindows = Words(docs)/2
  16.  
  17.   GetScreenInfo
  18.   screenWidth  = Word(RESULT,3)
  19.   screenHeight = Word(RESULT,4)
  20.  
  21.   wHeight = (screenHeight-2) % numWindows
  22.   yPos    = 2
  23.  
  24.   DO i=1 TO numWindows
  25.     IF (i = numWindows) THEN DO
  26.       wHeight = wHeight+2
  27.     END
  28.  
  29.     INTERPRET ADDRESS Word(docs,(i*2))
  30.     GetWindowInfo
  31.     PARSE VAR RESULT dum wX wY sX sY .
  32.  
  33.     /* If sizing first would put it off the screen, size it last */
  34.     IF ((wY+wHeight > screenHeight) | (wX>0)) THEN DO
  35.       MoveWindow (-wX) (yPos-wY)
  36.       SizeWindow screenWidth-sX (wHeight-2)-sY
  37.  
  38.     END; ELSE DO
  39.       SizeWindow screenWidth-sX (wHeight-2)-sY
  40.       MoveWindow (-wX) (yPos-wY)
  41.  
  42.     END
  43.  
  44.     yPos = yPos+wHeight
  45.   END
  46.